#!/usr/bin/env python
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2008, Matt Layman"
__author__ = "Matt Layman <laymansterms.dev@gmail.com>"

import unittest
import sys
import os
import shutil

sys.path += [os.path.abspath('..')]

from backend.backend_server import BackendServer

#class TestBackendServer(unittest.TestCase):
#    """This test class tests functions of the backend server"""
#    
#    def setUp(self):
#        self.backend = BackendServer()
#        
#    def tearDown(self):
#        self.backend.quitBackend()
#    
#    def testBackendServerCreateConfiguration(self):
#        """testBackendServerCreateConfiguration - Ensures that the
#        configuration directory is setup properly"""
#        # Rename the real config directory to backup
#        self.backup_path = self.backend.config_path + "_test"
#        if os.path.exists(self.backend.config_path):
#            os.rename(self.backend.config_path, self.backup_path)
#        
#        self.backend.create_configuration()
#        self.assertTrue(os.path.exists(self.backend.config_path))
#        
#        # Restore the existing config directory
#        if os.path.exists(self.backend.config_path):
#            shutil.rmtree(self.backend.config_path)
#        os.rename(self.backup_path, self.backend.config_path)
        